Repository navigation
chore(agents): run the agent tooling tests apart from the package tests - #737
Merged
Merged
Conversation
Publishing runs npm test through prepublishOnly. A slow agent-tooling test timing out there broke outline-cli's 3.2.0 publish, and the same setup is here: npm test also ran the tests in .agents/scripts. npm test now runs only the package's own tests. The agent tooling's tests get their own config, vitest.agents.config.ts, and script, npm run test:agents. CI runs it on every pull request, after npm test. npm run verify runs it only when something those tests read changed since main, through a new onlyWhenChanged on verify steps; otherwise it says it skipped them and CI runs them.
doistbot
reviewed
Dec 3, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
This PR cleanly splits the test suites: npm test now runs only the package's tests, the agent tooling's tests move to vitest.agents.config.ts behind a new npm run test:agents script that CI runs on every pull request, and verify gains a well-tested onlyWhenChanged skip so agent tests run locally only when something they read has changed. The split is coherent end to end, and the config changes preserve behavior the agent tests rely on.
Few things worth tightening:
- With
prepublishOnlyno longer covering the agent tooling, no workflow runsnpm run test:agentson merge tomain— the release workflow could run it in its own job or step (off the publish path) to keep merge-skew breakage detectable and stay within the Tests standard.
I also included a few optional follow-up notes in the details below.
Optional follow-up notes (4)
.agents/scripts/lib/verify.ts:80: When nothing changed since the base,
changesis[]butchangedis still{ paths: [] }, sotests:agentsis skipped right after verify prints "No changes since main; checking the tree anyway." The message promises the whole tree runs, then the agent tests don't. Either passundefinedwhenchanges.length === 0(running every step, matching the message) or reword the no-changes message so the skip isn't a contradiction. The existing test for this case only usespass('lint'), so noonlyWhenChangedstep exercises it..agents/scripts/lib/verify.ts:80: This new
changedshadows the existingconst changed = changedCodePaths(before, after)in the "Files changed during the run" block a few lines below, so the same name now means two different things in one function. Renaming one of them (e.g.stepsChangeshere, orchangedPathsthere) keeps the two concerns distinct.vitest.config.ts:11: The split itself is unguarded. Nothing fails if this
includeregains.agents/(publishing runs the agent tests again — the timeout that broke a publish) or if a test file lands outside bothsrc/and.agents/scripts/and so runs in neithernpm testnornpm run test:agents.steps.test.tsalready reads repo config to compare verify with CI, so a test asserting every tracked*.test.tsis matched by exactly one of the two configs'includewould pin both directions.package.json:22: Before this split,
npm run test:watch(plainvitest) also watched the agent tooling's tests; now it watches only the package's tests, and there is no watch counterpart fortest:agents. Anyone iterating on.agents/scripts/has to rerun the fulltest:agentscommand each cycle. Consider atest:agents:watchscript (vitest --config vitest.agents.config.ts), or mention the manual command in the write-tests skill.
…n unchanged tree npm run verify skipped the agent tooling tests when nothing changed, right after saying it checks the tree anyway, and when a file was deleted or renamed, though instructions.test.ts checks every file the agent docs name. It now runs them in both cases. test.yml also runs on pushes to main and next, so both test suites run on every merge without the agent tooling's being on the publish path. The agent tooling's tsconfig no longer loads vitest's global types, as their config doesn't enable globals. The test helpers folder is shared between instructions.test.ts and verify's step, and the docs say pre-push runs only the package's tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishing runs
npm testthroughprepublishOnly, andnpm testalso ran the agent tooling's tests in.agents/scripts/. A slow agent-tooling test timing out there broke outline-cli's 3.2.0 publish, and this repo has the same setup. Publishing should only run the tests for what it publishes.npm test(vitest.config.ts) now covers only the package's own tests. The agent tooling's tests move tovitest.agents.config.tsand a newnpm run test:agentsscript.test.ymlruns it right afternpm test, on every pull request and every push tomainandnext, so every test still runs in CI and both suites run on every merge, without the agent tooling's being on the publish path.npm run verifygains anonlyWhenChangedoption on its steps. The newtests:agentsstep runs only when something those tests read changed sincemain(.agents/, its config, the agent docs,src/test-support/, the workflows,package.json, the lockfile,tsconfig.json,lefthook.ymland the agent configs), when a file was deleted or renamed (instructions.test.tschecks every file the agent docs name exists), or when nothing changed, since verify then checks the tree anyway. Otherwise it prints- tests:agents skipped: nothing it reads changed since main; CI runs it on every pull requestand counts as passed. It starts after the package's tests:package-contents.test.tspacksdist/, which those rewrite, and two vitest pools side by side slow each other into timeouts.The agent tooling's tsconfig no longer loads
vitest/globals, sincevitest.agents.config.tsdoesn't enable globals. AGENTS.md, CODEBASE.md, CONTRIBUTING.md, docs/agents.md and the verify and write-tests skills describe the split.